<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Flot Examples: Log Scale</title>
  <link href="../examples.css" rel="stylesheet" type="text/css">
  <script language="javascript" type="text/javascript" src="../../source/jquery.js"></script>
  <script language="javascript" type="text/javascript" src="../../source/jquery.canvaswrapper.js"></script>
	<script language="javascript" type="text/javascript" src="../../source/jquery.colorhelpers.js"></script>
	<script language="javascript" type="text/javascript" src="../../source/jquery.flot.js"></script>
	<script language="javascript" type="text/javascript" src="../../source/jquery.flot.saturated.js"></script>
	<script language="javascript" type="text/javascript" src="../../source/jquery.flot.browser.js"></script>
	<script language="javascript" type="text/javascript" src="../../source/jquery.flot.drawSeries.js"></script>
	<script language="javascript" type="text/javascript" src="../../source/jquery.flot.uiConstants.js"></script>
	<script language="javascript" type="text/javascript" src="../../source/jquery.flot.logaxis.js"></script>
  <script type="text/javascript">
    $(function () {

      function piTickGenerator(axis) {
        var res = [],
          i = Math.floor(axis.min / Math.PI);
        do {
          var v = i * Math.PI;
          res.push([v, i + "\u03c0"]);
          ++i;
        } while (v < axis.max);
        return res;
      }

      var d1 = [];
      for (var i = 0; i < 14; i += 0.5) {
        d1.push([i, Math.sin(i)]);
      }

      var d1 = [];
      for (var i = 0; i < 14; i += 0.2) {
        d1.push([i, 1.01 + Math.sin(i)]);
      }

      var d2 = [[0.1, 3], [4, 8], [8, 5], [9, 13]];

      // A null signifies separate line segments

      var d3 = [[0.1, 12], [5, 5], null, [9, 2.5], [12, 5]];

      var d4 = [];
      for (var i = 0; i < 14; i += 0.5) {
        d4.push([i, 300 + Math.sin(i) * 200]);
      }


      $.plot("#placeholder", [d1, d2, d3, d4], {
        series: {
          lines: {
            show: true
          },
          points: {
            show: true
          }
        },
        xaxis: {
          ticks: piTickGenerator
        },
        yaxis: {
          mode: "log",
          showTickLabels: "all"
        }
      });

      // Add the Flot version string to the footer

      $("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
    });
  </script>
</head>

<body>

  <div id="header">
    <h2>Log scale</h2>
  </div>

  <div id="content">

    <div class="demo-container">
      <div id="placeholder" class="demo-placeholder"></div>
    </div>

    <p>PI multiples tick formatting for X axis and logarithmic axis on Y axis.</p>
  </div>

  <div id="footer">
    Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
  </div>

</body>

</html>
